#!/usr/bin/python
# coding:utf-8
# auther:DT
# 2017-08-08_18-03-07

import nmap
nm = nmap.PortScanner()
PORT = [21,22,80,3306,139,111,8080]

nm.scan('192.168.0.0/24','111,139,21,22,80,3306,8080',arguments='') 

for i in nm.all_hosts():
    for n in PORT:
        if nm[i]['tcp'][n]['state'] == 'open':
             print("ip:%s port:%s  is up" % (i,n))
